<?php

namespace app\cms\home;

use think\Db;


class Index extends Common
{
    public function index()
    {
        $data=Db::name('cms_document')
            ->order('id desc')
            ->paginate(20);
        $dataArr=$data->items();
        foreach ($dataArr as $key=>$v){
            $dataArr[$key]['content']=Db::name('cms_document_article')
                ->where(['aid'=>$v['id']])
                ->find();
        }
        $this->assign('data',$dataArr);
        return $this->fetch();
    }
}